package com.stroke.entity.impl;

import com.stroke.graphics.Animation;
import com.stroke.resources.GraphicResources;
import com.stroke.tools.animation.AnimationFile;
import com.stroke.util.SampleImageFactory;
import com.stroke.entity.AbstractEntity;

import java.awt.*;
import java.awt.event.KeyEvent;

/**
 * Author: Igor Bubelov
 * Date: 3/6/11 3:02 PM
 */
public class SampleEntity extends AbstractEntity {
    public SampleEntity() {
        setImage(GraphicResources.get("sample-animation"));
        setOrigin(new Point(64, 64));
    }

    public SampleEntity(int x, int y) {
        this();
        shift(x, y);
    }

       @Override
       public void keyPressed(KeyEvent e) {
           switch (e.getKeyCode()) {
               case KeyEvent.VK_UP : {
                   shift(0, -5);
                   break;
               }
               case KeyEvent.VK_DOWN : {
                   shift(0, 5);
                   break;
               }
               case KeyEvent.VK_LEFT : {
                   shift(-5, 0);
                   break;
               }
               case KeyEvent.VK_RIGHT : {
                   shift(5, 0);
                   break;
               }
           }
       }
   }
    